1. Field of the Invention
The present invention relates to an image processing apparatus having a management system for an image storage area when image data stored in an image memory is accessed during execution of a program and, more particularly, to an image processing apparatus capable of effectively managing an image storage area.
2. Related Background Art
A conventional image processing system comprises a computer such as a general-purpose microcomputer and image processing hardware (e.g., an image memory and an image processor are circuit components of the image processing hardware). High-speed processing can be performed by image processing hardware functions. In recent years, the following hardware has become commercially available. A function for directly allocating an external bus area to a virtual memory area is added to an engineering work station (EWS), and an image memory can be directly accessed by address data on an external address bus of the EWS. High-speed operations and software flexibility have been requested in image processing systems, and the above system eliminates data transfer between the main memory and the image memory or allows high-speed data transfer between them. Therefore, an application program which satisfies both requirements of high-speed processing and flexibility can be obtained. Examples of this system are an EWS Sun3/260C available from Sun Micro Corp. and a combination of image processing hardware NEXUS6810 (available from NEXUS Corp.) and VME expansion boards.
FIG. 1--1 shows such a system configuration. This system mainly comprises an EWS 101 serving as a host station and an image processing apparatus 102 joined by a system bus 107. The EWS 101 includes a CPU 103 and a main memory 106. The image processing apparatus 102 includes an image memory 104 and an image processor 105 joined by an exclusive bus 108. The above-mentioned computer equipment is used to arrange this system. Image data in the image memory 104 can be processed by either the image processor 105 or the CPU 103.
[I] A program including processing using the image processor and software processing by the CPU in the EWS in the image processing system has the following structure.
A series of image processing is performed such that (i) a given original image is subjected to edge emphasis, (ii) the edge-emphasized image is subjected to noise elimination (smoothing), and (iii) the smoothed image is finally subjected to dither processing. In this case, operations (i) and (ii) are performed by the image processor, while operation (iii) is performed by the CPU. This program is used in the following operations. That is, an original image is input to, e.g., a first frame of an image memory, operation (i) is performed for the image of the first frame, and the processing result is stored in a second frame. Operation (ii) is performed for the image of the second frame, and the processing result is stored in a third frame. After a state is obtained in which the third frame and a fourth frames can be directly accessed by the CPU in correspondence with a virtual memory area, operation (iii) is performed by utilizing the virtual memory addresses of the virtual memory area, and the processing result is stored in the fourth frame. Physical data storage areas such as the first, second, third, and fourth frames are required in the program because the memory management mechanism of an EWS operating system (OS) cannot be applied to an external memory such as an image memory. In a program of this type, a programmer must manage a correspondence between frames of the image memory and corresponding image data, and a correspondence between the processing result and the corresponding storage locations. This allocation can be decided at the time of programming. Therefore, only the permanent program which defines fixed frames is available.
The above program includes the following disadvantages:
A. It is difficult to utilize image data areas such as processing results of other programs (processes) and set the areas without erasing the processing results; and PA1 B. The program must be significantly corrected whenever an image memory is added or the hardware configuration is changed. PA1 DIMENSION IMAGE PA1 (512, 512) PA1 int image[512][512] PA1 (1) location conversion must be performed if the location method of the image data immediately before an application of a processing module is different from that of the processing module, or PA1 (2) the processing module by the CPU in the EWS is entirely reprogrammed to process the image data of the fixed location method. PA1 A. In technique (1), since a location conversion program must be generated and utilized in accordance with the content of the processing module and the condition of the image data, programming is overloaded. PA1 B. In technique (2), cumbersome, time-consuming programming operations are required since many existing programs are reprogrammed. PA1 C. Since hardware configuration information is included in the module, many correction operations are required for changing the hardware configuration. PA1 A. It is difficult to input and utilize the image data of processing results of other programs (processes) without going through a secondary memory or set the areas without erasing the image data. PA1 B. The correspondence between the image memory in the main memory in the computer and the image data in the image memory in the image processing apparatus must be set in the program itself. Therefore, the image memory areas of other processes may be destroyed during execution of this program. PA1 C. Many program correction operations are required when an image memory is added or the hardware configuration is changed. PA1 A. the image data in the computer is allocated to a common memory used by a plurality of processes, and PA1 B. a management process is arranged to independently, systematically manage allocation of the common memory in the computer and the image memory in the image processing apparatus.
The above program must be written under the condition that another image has previously been input to the first frame and should not be lost. In addition, when processing is complicated, the correspondence between the frames and the image data overloads the programmer.
[II] When programming is made to perform the following operations: (i) a given original image is subjected to edge emphasis, (ii) the edge-emphasized image is subjected to noise elimination (smoothing), and (iii) the smoothed image is finally subjected to dither processing. Operations (i) and (ii) are performed by the image processor, while operation (iii) is performed by the CPU. In the image processing system, processing by the image processor and processing by the CPU in the EWS are utilized in a mixed manner.
Assume an image having X pixels in the horizontal direction and Y pixels in the vertical direction is to be dealt with. A commercially available processing apparatus as described above has a two-dimensional address space fixed by hardware to represent frames each serving as a processing unit of the processor. The image data must be stored as a matrix in the address space. Therefore, when the image processor is used, the image data must be located in a location format (to be referred to as a "fixed location" method) as shown in FIG. 1-2(a). FIG. 1-2(b) is a memory map when the location of FIG. 1-2(a) is viewed from the CPU in the EWS. When processing is performed by the CPU in the EWS, the image data is located in a continuous area (to be referred to as a "continuous location" method hereinafter) in formats of X*Y (pixels) such as
in programming language FORTRAN and
in programming language C.
These formats are represented by an address format and a memory map in units of frames, as indicated by FIGS. 1-2(c) and 1-2(d).
In order to utilize the processing by the image processor and processing by the CPU in the EWS in a mixed manner since the location methods in the image data memory are different,
In either technique, the following disadvantages are presented.
[III] In the above imaging processing system, processing by the image processor is suitable for processing the image data in the image memory, while processing by the CPU in the computer is suitable for processing the image data in the main memory. Therefore, when a program including processing by the image processor and processing by the CPU in the computer is prepared, the image data must be allocated to the main memory in the computer and the image memory in the image processing apparatus while processing progresses. Alternatively, the image data must be transferred between the main memory and the image memory in the image processing apparatus.
The above program has the following disadvantages.
The programmer is overloaded by these disadvantages, and compatibility of the image processing program is impaired mainly by these disadvantages. In addition, transfer of the image data between the common memory and the image memory must be written in to the program.